package com.ruoyi.miniapp.service.impl;

import java.util.List;

import com.ruoyi.miniapp.api.domain.AppUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.miniapp.mapper.AppUserMapper;
import com.ruoyi.miniapp.service.IAppUserService;

import javax.annotation.Resource;

/**
 * 用户登录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-26
 */
@Service
public class AppUserServiceImpl implements IAppUserService 
{
    @Resource
    private AppUserMapper appUserMapper;

    /**
     * 查询用户登录
     * 
     * @param loginId 用户登录主键
     * @return 用户登录
     */
    @Override
    public AppUser selectAppUserByLoginId(Long loginId)
    {
        return appUserMapper.selectAppUserByLoginId(loginId);
    }

    /**
     * 查询用户登录列表
     * 
     * @param appUser 用户登录
     * @return 用户登录
     */
    @Override
    public List<AppUser> selectAppUserList(AppUser appUser)
    {
        return appUserMapper.selectAppUserList(appUser);
    }

    /**
     * 新增用户登录
     * 
     * @param appUser 用户登录
     * @return 结果
     */
    @Override
    public int insertAppUser(AppUser appUser)
    {
        return appUserMapper.insertAppUser(appUser);
    }

    /**
     * 修改用户登录
     * 
     * @param appUser 用户登录
     * @return 结果
     */
    @Override
    public int updateAppUser(AppUser appUser)
    {
        return appUserMapper.updateAppUser(appUser);
    }

    /**
     * 批量删除用户登录
     * 
     * @param loginIds 需要删除的用户登录主键
     * @return 结果
     */
    @Override
    public int deleteAppUserByLoginIds(Long[] loginIds)
    {
        return appUserMapper.deleteAppUserByLoginIds(loginIds);
    }

    /**
     * 删除用户登录信息
     * 
     * @param loginId 用户登录主键
     * @return 结果
     */
    @Override
    public int deleteAppUserByLoginId(Long loginId)
    {
        return appUserMapper.deleteAppUserByLoginId(loginId);
    }


    @Override
    public AppUser selectUserByTel(String tel) {
        return appUserMapper.selectUserByTel(tel);
    }
}
